<?php if(!defined("PATH_HD"))exit;C("SHOW_NOTICE",false);?><?php if(!defined("PATH_HD"))exit;C("SHOW_NOTICE",false);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>        
        <title></title>
        <meta http-equiv="content-type" content="text/htm;charset=utf-8"/>
        <link type="text/css" rel="stylesheet" href="http://192.168.10.155:8080/sz-ica/admin/tpl/public/css/common.css"/>
        <script type='text/javascript' src='http://192.168.10.155:8080/sz-ica/hdphp/plugin/jquery-1.8.2.min.js'></script>
        <my_jqueryui/>
       <script type="text/javascript" src="http://192.168.10.155:8080/sz-ica/admin/tpl/public/js/admin.js"></script>
        <script type='text/javascript'>
            $(function(){
                $('tr').mouseover(function(){
                    $(this).css('background-color','#f6f6f6');
                }).mouseout(function(){
                    $(this).css('background-color','#fff');
                });
            });
        </script>
    </head>
    <body>
        <div id="hd_jqueryui_div"></div>
<ul class="top_title">
    <li>
        <p class="menu_title">检索结果</p>
    </li>
    <li>|</li>
    <li>
        <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/addInfo" class="menu_title_a" >
            <i class="icon icon-plus-sign"></i>&nbsp;添加内容
        </a>
    </li>
    <li>  &nbsp;|</li>
    <li class="menu_title">分类筛选:</li>
    <li>
        <form action="http://192.168.10.155:8080/sz-ica/admin.php/Info/infoShow" method="post" >
            <ul>
                <li>&nbsp;&nbsp;&nbsp;&nbsp;
                    <select name='listTitle' id='listTitle'>
                        <?php echo $fenlei;?>
                    </select>
                </li>
                <li> |</li>
                
                <li class="menu_title">排序方式:</li>
                <li>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <select name='sort' id='sort'>
                        <option value='addtime' <?php if($_GET['sort']=='addtime') echo "selected='selected'";?>>发表日期</option>
                        <option value='id' <?php if($_GET['sort']=='id') echo "selected='selected'";?>>ID</option>

                    </select>
                </li>
            </ul>

        </form>    

    </li>
    
  
</ul>

    <table class="table">
        <thead>
            <tr class="top_channel">
                <th align="center" width="60">文章ID</th>
                <th width='20'></th>
                <th align="center" width="26%">标题</th>
                <th align='center' width='88'>所属分类</th>
                <th align='center' width='88'>发表日期</th>
                <th align='center' width='130'>是否使用</th>
                <th align="center">操作</th>
            </tr>
        </thead>
        <tbody>
      

        <?php if(is_array($list)):?><?php  foreach($list as $v){ ?>
            <tr class="top_channel">
           
                <td align="center">
                    <input type="text" disabled="disabled" value="<?php echo $v['id'];?>"  class="input-medium"/>
                </td>
                <td width='20'></td>
                <td align="center" class="dis">
                  <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/editInfo?id=<?php echo $v['id'];?>"> <?php echo $v['title'];?></a>
                </td>
               <td align='center'><?php echo $v['lname'];?></td>
                
               <td align='center'><?php echo date('Y-m-d H:i:s',$v['addtime']);?></td>
               <td align='center'>
                  
                   <?php if($v['isshow'] ==1){?>
                        <span class="btn isshow" id='<?php echo $v['id'];?>' style='color:#888'  zt='<?php echo $v['isshow'];?>' >使用</span>
                        <?php  }else{ ?>
                        <span class="btn isshow" id='<?php echo $v['id'];?>' style='color:#f60'  zt='<?php echo $v['isshow'];?>' >禁止</span>

                    <?php }?>
                    
                    <?php if($v['istop'] == 1){?>|<span style="color:#f60;">已置顶</span><?php }?>
               </td>

                <td align="center">
                
                    <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/editInfo?id=<?php echo $v['id'];?>" class="isok btn edit">

                        <i class="icon icon-edit"></i>&nbsp;编辑
                    </a>
                    | <a href="http://192.168.10.155:8080/sz-ica/admin.php/Info/delInfo?id=<?php echo $v['id'];?>" class="isok btn del">
                      
                        <i class="icon icon-trash"></i>&nbsp;删除
                    </a>
                </td>
            </tr>
        <?php }?><?php endif;?>

            <tr class="top_channel">
                <td></td>
                <td align="center">
                    
                </td>
                <td colspan="5"><?php echo $page;?> </td>
            </tr>
        </tbody>
    </table>
    <script type='text/javascript'>
    $(function(){
            $('.del').click(function(){
            var cn = confirm('确定删除吗？');
            if(!cn){
                return false;
            }
            });


            var METH = 'http://192.168.10.155:8080/sz-ica/admin.php/Info/infoShow';
            var ROOT = 'http://192.168.10.155:8080/sz-ica/admin.php/Info/infoShow';
        //分类筛选
        $('#listTitle').change(function(){
            //alert($(this).val());
            location.href=ROOT+'/fenlei/'+$(this).val();
            exit(0);
        });
        $('#sort').change(function(){//排序

            location.href=ROOT+'/sort/'+$(this).val();
            exit(0);
        });

        //内容异步使用禁止
         $('.isshow').live('click',function(){
            var id = $(this).attr('id');
            var zt = $(this).attr('zt');
            zt = zt=='1'?'2':'1';
            ajaxChange(id,zt);

         });

    });



    function ajaxChange(id,zt){
          
             $.post('http://192.168.10.155:8080/sz-ica/admin.php/Info/'+'ajaxInfoShow',{'id':id,'zt':zt},function(data){
               if(data.id){//返回真，更新成功，修改前台css显示
                  if(data.isshow=='1'){
                      $('#'+data.id).css('color','#888').attr('zt',data.isshow).html('使用');
                  }else{
                      $('#'+data.id).css('color','#f60').attr('zt',data.isshow).html('禁止');
                  }
                  
                
               }else{
                  alert('出错了');
               }
            },"json");
        
    }

    </script>

</body>
</html>